package net.pws.oos.web.dto;

import java.util.ArrayList;
import java.util.List;

import net.pws.common.beanutils.BeanUtils;
import net.pws.oos.biz.model.PhotoMarker;

public class PhotoMarkerDto extends PhotoMarker {

	private static final long serialVersionUID = 3480266994523499125L;

	public static PhotoMarkerDto from(Object src) {
		PhotoMarkerDto dto = new PhotoMarkerDto();
		BeanUtils.copyProperties(dto, src);
		return dto;
	}

	public static List<PhotoMarkerDto> from(List<PhotoMarker> markers) {
		List<PhotoMarkerDto> dtos = new ArrayList<PhotoMarkerDto>();
		for (PhotoMarker marker : markers) {
			dtos.add(PhotoMarkerDto.from(marker));
		}
		return dtos;
	}

	public static PhotoMarker to(PhotoMarkerDto dto) {
		PhotoMarker marker = new PhotoMarker();
		BeanUtils.copyProperties(marker, dto);
		return marker;
	}

}
